import { createRouter, createWebHistory } from "vue-router";
import homeView from "@/views/home/home.vue";
import indexView from "@/views/home/index.vue";
import claView from "@/views/home/cla.vue";
import cartView from "@/views/home/cart.vue";
import myView from "@/views/home/my.vue";
import searchView from "@/views/search/index.vue";
const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: "/", redirect: "/home/index" },
    {
      path: "/home",
      name: "home",
      component: homeView,
      children: [
        { path: "index", name: "index", component: indexView },
        { path: "cla", name: "cla", component: claView },
        { path: "cart", name: "cart", component: cartView },
        { path: "my", name: "my", component: myView },
      ],
    },
    { path: "/search", name: "search", component: searchView },
  ],
});
export default router;
